/*
 * @Author: lp
 * @Date: 2022-01-20 17:22:35
 * @LastEditTime: 2022-01-21 10:47:27
 * @LastEditors: Please set LastEditors
 * @Description: 系统菜单接口
 * @FilePath: \nien-vue3-admin\src\api\system\menu.ts
 */
import request from "@/utils/request";

export const treeselect = () =>
  request({
    url: "/system/menu/treeselect",
  });

export const roleMenuTreeselect = (roleId) =>
  request({
    url: "/system/menu/roleMenuTreeselect/" + roleId,
  });

export const listMenu = (params?) =>
  request({
    url: "/system/menu/list",
    params,
  });

export const getMenu = (menuId) =>
  request({
    url: "/system/menu/" + menuId,
  });

export const updateMenu = (data) =>
  request({
    url: "/system/menu",
    method: "put",
    data,
  });

export const addMenu = (data) =>
  request({
    url: "/system/menu",
    method: "post",
    data,
  });

export const delMenu = (menuId) =>
  request({
    url: "/system/menu/" + menuId,
    method: "delete",
  });
